<!-- 绿色通道 - 患者列表 - 医疗记录 - 基本信息(新) 界面 -->
<template>
  <div id="basicInfo">
    <div id="info_basic">
      <h3 class="title_lv3"> 基本信息</h3>
      <el-form
        :inline="true"
        :model="infoBasic"
        class="demo-form-inline pageForm"
        label-position="right"
        label-width="80px"
        disabled
        size="small"
      >
        <el-form-item label="患者姓名">
          <el-input v-model="infoBasic.name" placeholder="" />
        </el-form-item>
        <el-form-item label="性别">
          <el-select v-model="infoBasic.sex" placeholder="">
            <el-option label="男" value="男" />
            <el-option label="女" value="女" />
            <el-option label="未知" value="未知" />
          </el-select>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input v-model="infoBasic.age" placeholder="">
            <template slot="append">岁</template>
          </el-input>
        </el-form-item>
        <el-form-item label="体重">
          <el-input v-model="infoBasic.weight" placeholder="">
            <template slot="append">kg</template>
          </el-input>
        </el-form-item>
        <el-form-item label="BMI">
          <el-input v-model="infoBasic.BMI" placeholder="" />
        </el-form-item>
        <el-form-item label="发病时间">
          <el-date-picker
            v-model="infoBasic.incidentDateTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder=""
          />
        </el-form-item>
        <el-form-item v-if="false" label="">
          <el-checkbox v-model="infoBasic.val">发病时间无法精确到分钟</el-checkbox>
          <el-select v-model="infoBasic.val" placeholder="">
            <el-option label="凌晨(0点到6点)" value="凌晨(0点到6点)" />
            <el-option label="清晨(6到8点" value="清晨(6到8点" />
            <el-option label="上午(8到12点)" value="上午(8到12点)" />
            <el-option label="中午(12到14点)" value="中午(12到14点)" />
            <el-option label="下午(14到17点)" value="下午(14到17点)" />
            <el-option label="傍晚(17到19点)" value="傍晚(17到19点)" />
            <el-option label="晚上(19到24点)" value="晚上(19到24点)" />
          </el-select>
        </el-form-item>
        <el-form-item label="来院时间">
          <el-date-picker
            v-model="infoBasic.incidentDateTime"
            value-format="yyyy-MM-dd HH:mm:ss"
            type="datetime"
            placeholder=""
          />
        </el-form-item>
        <el-form-item label="来院方式">
          <el-radio-group v-model="infoBasic.modeOfArrival">
            <el-radio label="呼叫出车">呼叫出车</el-radio>
            <el-radio label="转院">转院</el-radio>
            <el-radio label="自行来院">自行来院</el-radio>
            <el-radio label="院内发病">院内发病</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <el-form
        :inline="true"
        :model="infoBasic"
        class="demo-form-inline pageForm"
        label-position="right"
        label-width="150px"
        disabled
        size="small"
      >
        <div>
          <el-form-item label="出车单位" required>
            <el-select v-model="infoBasic.ambulanceDepartment" placeholder="">
              <el-option label="120救护车" value="120救护车" />
              <el-option label="本院救护车" value="本院救护车" />
              <el-option label="外院救护车" value="外院救护车" />
            </el-select>
          </el-form-item>
          <el-form-item label="呼救时间" required>
            <el-date-picker v-model="infoBasic.helpDate" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
          </el-form-item>
          <el-form-item label="首次医疗接触时间" required>
            <el-date-picker
              v-model="infoBasic.firstMedicalContactDateTime"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              placeholder=""
            />
          </el-form-item>
        </div>
        <div>
          <el-form-item label="首诊医生接诊时间" required>
            <el-date-picker
              v-model="infoBasic.inhospitalAdmissionTime"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              placeholder=""
            />
          </el-form-item>
          <el-form-item label="到达本院大门时间" required>
            <el-date-picker v-model="infoBasic.arrivalTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
          </el-form-item>
          <el-form-item label="  医护人员">
            <el-input v-model="infoBasic.cw120FirstDoctorName" placeholder="" />
          </el-form-item>
        </div>
      </el-form>
      <el-form :inline="true" class="demo-form-inline pageForm" label-position="right" label-width="150px" size="small">
        <el-row :gutter="20">
          <el-col :span="20" style="border: 1px solid #eee;">
            <div v-if="imgUrlList.length>0" class="demo-image" style="overflow: auto; white-space: nowrap; min-height: 100px; ">
              <div v-for="url in imgUrlList" :key="url" class="disInBlock imgStyle">
                <el-image style="width: auto; height: 300px" :src="url" fit="scale-down" />
                <!-- :preview-src-list="imgUrlList" -->
              </div>
            </div>
            <div v-else id="" style=" color: #d5d5d5;">
              <p style="text-align: center;margin: 40px; font-size: 20px;">暂无心电图</p>
            </div>
          </el-col>
          <el-col :span="2">
            <el-button style="margin: 5px;" @click="dialogGroupConsultation=true">邀请会诊</el-button>
            <a href="#treatment_decision">
              <el-button type="primary" style="margin: 5px;">书写报告</el-button>
            </a>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <hr class="" style="background-color:#9dc8ff;height: 1px;width:100%;border: none;">
    <div id="info_detail">
      <h3 class="title_lv3"> 详细信息</h3>
      <el-form
        :model="infoDetail"
        :inline="true"
        class="demo-form-inline pageForm"
        label-position="right"
        label-width="90px"
        disabled
        size="small"
      >
        <el-form-item label="主诉" style="width:50%" class="disBlock">
          <el-input v-model="infoDetail.chiefComplaint" placeholder="" class="minWidth_200" />
        </el-form-item>
        <el-form-item label="现病史" style="width:50%" class="disBlock">
          <el-input v-model="infoDetail.initialImpression" placeholder="" class="minWidth_200" />
        </el-form-item>
        <el-form-item label="既往史" style="width:50%" class="disBlock">
          <el-input v-model="infoDetail.previousIllness" placeholder="" class="minWidth_200" />
        </el-form-item>

        <div id="vital_signs">
          <!-- ***************************************************生命体征 *************************************************** -->
          <p>生命体征</p>
          <div v-for="item in infoDetail.clinicalSignList" :key="item.userName" class="vital_signs_info marLeft_20" style="border-bottom: 1px solid #eee">
            <p>
              <span>{{ item.createdAt }}</span>&nbsp;
              <!-- <span>17:55</span>&nbsp;&nbsp; -->
              <span>{{ item.department }}</span>&nbsp;&nbsp;
              <span>{{ item.userName }}</span>
            </p>
            <div>
              <el-form-item label="检查开始：">
                <el-date-picker v-model="item.startTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
              <el-form-item label="报告完成：">
                <el-date-picker v-model="item.endTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </div>
            <div>
              <el-form-item label="意识：">
                <el-select v-model="item.consciousnessNote" placeholder="">
                  <el-option label="" value="请选择" />
                  <el-option label="清醒" value="清醒" />
                  <el-option label="对语言有反应" value="对语言有反应" />
                  <el-option label="对刺痛有反应" value="对刺痛有反应" />
                  <el-option label="对任何刺激无反应" value="对任何刺激无反应" />
                </el-select>
              </el-form-item>
              <el-form-item label="呼吸：">
                <el-input v-model="item.rr" placeholder="">
                  <template slot="append">次/分钟</template>
                </el-input>
              </el-form-item>
              <el-form-item label="脉搏：">
                <el-input v-model="item.pr" placeholder="">
                  <template slot="append">次/分钟</template>
                </el-input>
              </el-form-item>
              <el-form-item label="心率：">
                <el-input v-model="item.hr" placeholder="">
                  <template slot="append">次/分钟</template>
                </el-input>
              </el-form-item>
              <el-form-item label="收缩压：">
                <el-input v-model="item.sys" placeholder="">
                  <template slot="append">mmHg</template>
                </el-input>
              </el-form-item>
              <el-form-item label="舒张压：">
                <el-input v-model="item.dia" placeholder="">
                  <template slot="append">mmHg</template>
                </el-input>
              </el-form-item>
              <el-form-item label="血氧：">
                <el-input v-model="item.spo2" placeholder="">
                  <template slot="append">%</template>
                </el-input>
              </el-form-item>
              <el-form-item label="体温：">
                <el-input v-model="item.t1" placeholder="">
                  <template slot="append">℃</template>
                </el-input>
              </el-form-item>
            </div>
          </div>
          <!-- ***************************************************生命体征-End*************************************************** -->
          <!-- *************************************************** POCT *************************************************** -->
          <p>POCT</p>
          <div v-for="item in infoDetail.POCTList" :key="item.userName" class="poct_info marLeft_20" style="border-bottom: 1px solid rgb(238, 238, 238);">
            <p>
              <span>{{ item.excutetime }}</span>&nbsp;
              <span>{{ item.department }}</span>&nbsp;&nbsp;
              <span>{{ item.userName }}</span>
            </p>
            <div>
              <el-form-item label="检查开始：">
                <el-date-picker v-model="item.BLOOD_TIME" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
              <el-form-item label="报告完成：">
                <el-date-picker v-model="item.REPORT_TIME" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
              </el-form-item>
            </div>
            <div>
              <el-form-item label="肌钙蛋白：">
                <el-radio-group v-model="item.TNT_OR_TNI">
                  <el-radio :label="1">肌钙蛋白T</el-radio>
                  <el-radio :label="2">肌钙蛋白I</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="">
                <el-input v-model="item.VALUE" placeholder="" />
              </el-form-item>
              <el-form-item label="">
                <el-select v-model="item.UNIT" placeholder="">
                  <el-option label="1" value="ng/mL" />
                  <el-option label="2" value="ug/L" />
                  <el-option label="3" value="ng/L" />
                  <el-option label="4" value="pg/mL" />
                  <el-option label="5" value="mg/L" />
                </el-select>
              </el-form-item>
              <el-form-item label="">
                <el-select v-model="item.STATUS" placeholder="">
                  <el-option label="请选择" value="请选择" />
                  <el-option label="阴性" value="阴性" />
                  <el-option label="阳性" value="阳性" />
                </el-select>
              </el-form-item>
              <!-- <el-form-item label="Cr：">
									<el-input placeholder="" v-model="item.val"> </el-input>
								</el-form-item> -->
            </div>
          </div>
          <!-- ***************************************************POCT-End*************************************************** -->
          <p />
          <el-form-item label="查体评估：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.bodychecklist" placeholder="" class="minWidth_200" />
          </el-form-item>
          <el-form-item label="当前给药：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.meidicallist" placeholder="" class="minWidth_200" />
          </el-form-item>
          <el-form-item label="当前处置：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.treatmentslist" placeholder="" class="minWidth_200" />
          </el-form-item>
          <el-form-item label="当前诊断：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.diagnosesModelList" placeholder="" class="minWidth_200" />
          </el-form-item>
          <el-form-item label="会诊时间：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.consultationsTime" placeholder="" class="minWidth_200" />
          </el-form-item>
          <el-form-item label="会诊医生：" style="width:50%" class="disBlock">
            <el-input v-model="infoDetail.consultationsDoctorlist" placeholder="" class="minWidth_200" />
          </el-form-item>

        </div>
      </el-form>
    </div>

    <hr class="" style="background-color:#9dc8ff;height: 1px;width:100%;border: none;">
    <div id="treatment_decision">
      <h3 class="title_lv3"> 治疗决定</h3>
      <div class="writeInfo  treatment_decision_info">
        <div class="group_consultation">
          <div class=" marLeft_20">
            <!-- 当前会诊 -->
            <p>会诊</p>
            <el-form
              :model="treatmentDecision"
              class="demo-form-inline pageForm"
              label-position="right"
              label-width="120px"
              size="small"
            >
              <el-form-item label="参与会诊医生：" style="width:50%" class="disBlock">
                <el-input v-model="treatmentDecision.doctorName" placeholder="" class="minWidth_200" disabled />
              </el-form-item>
              <el-form-item label="心内报告时间：" style="width:10%" class="disBlock">
                <el-date-picker
                  v-model="treatmentDecision.ElectrocardiographicReportTime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  type="datetime"
                  placeholder=""
                  class="minWidth_200"
                  disabled
                />
              </el-form-item>
              <el-form-item label="心内报告：" style="width:50%" class="disBlock">
                <el-input v-model="treatmentDecision.reportContent" placeholder="" class="minWidth_200" disabled />
                <!-- @change="reportChange()" -->
              </el-form-item>
              <el-form-item label="心内治疗方案：" class="disBlock">
                <el-input v-model="treatmentDecision.treatmentPlan" type="textarea" disabled />
                <!-- @change="programmeChange()" -->
              </el-form-item>
              <!-- <p class="treatment_decision_info_T_R">
									<span>2019年3月26日</span>&nbsp;
									<span>17:55</span>&nbsp;&nbsp;
									<span>120救护车</span>&nbsp;&nbsp;
									<span>张一二</span>
								</p>
								<p class="treatment_decision_info_B_R">
									<span>会诊操作日志</span>
								</p> -->
            </el-form>
          </div>
        </div>
        <div class="intracardiac_treatment_decision">
          <div class="marLeft_20" style="border-bottom: 1px solid rgb(238, 238, 238);">
            <p>心内治疗决定</p>
            <el-form
              :inline="true"
              :model="treatmentDecision"
              class="demo-form-inline pageForm"
              label-position="right"
              label-width="120px"
              disabled
              size="small"
            >
              <div class="formline">
                <el-form-item label="通知收入住院：">
                  <el-date-picker
                    v-model="treatmentDecision.notificationHospitalTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->

                <el-form-item label="转交：">
                  <el-date-picker
                    v-model="treatmentDecision.deliverTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->

                <el-form-item label="转院：">
                  <el-date-picker
                    v-model="treatmentDecision.transferHospitalTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->
              </div>
              <div class="formline">
                <el-form-item label="通知CT室：">
                  <el-date-picker
                    v-model="treatmentDecision.informCTRoomTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->
                <el-form-item label="通知超声室：">
                  <el-date-picker
                    v-model="treatmentDecision.informUltrasoundRoomTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->
              </div>
              <div class="formline">
                <el-form-item label="启动导管室：">
                  <el-date-picker
                    v-model="treatmentDecision.startConduitChamberTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->
                <el-form-item label="静脉溶栓：">
                  <el-date-picker
                    v-model="treatmentDecision.intravenousThrombolysisTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="treatmentDecision.val"> </el-input>
									</el-form-item> -->
              </div>
            </el-form>
          </div>
        </div>
      </div>
      <div v-for="(item,index) in decisionHistorical" :key="index" class="writeInfo  treatment_decision_info">
        <!-- <p class="treatment_decision_info_T_R">
						<span>2019年3月26日</span>&nbsp;
						<span>17:55</span>&nbsp;&nbsp;
						<span>120救护车</span>&nbsp;&nbsp;
						<span>张一二</span>
					</p>
					<p class="treatment_decision_info_B_R">
						<span>会诊操作日志</span>
					</p> -->
        <div class="group_consultation">
          <div class=" marLeft_20">
            <!-- 历史会诊 -->
            <p>会诊</p>
            <el-form class="demo-form-inline pageForm" label-position="right" label-width="150px" disabled size="small">
              <el-form-item label="参与会诊医生：" style="width:50%" class="disBlock">
                <el-input v-model="item.doctorName" placeholder="" class="minWidth_200" />
              </el-form-item>
              <el-form-item label="心内报告时间：" style="width:10%" class="disBlock">
                <el-date-picker
                  v-model="item.ElectrocardiographicReportTime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  type="datetime"
                  placeholder=""
                  class="minWidth_200"
                />
              </el-form-item>
              <el-form-item label="心内报告：" style="width:50%" class="disBlock">
                <el-input v-model="item.reportContent" placeholder="" class="minWidth_200" />
              </el-form-item>
              <el-form-item label="心内治疗方案：" class="disBlock">
                <el-input v-model="item.treatmentPlan" type="textarea" />
              </el-form-item>
            </el-form>
          </div>
        </div>
        <div class="intracardiac_treatment_decision">
          <div class="marLeft_20" style="border-bottom: 1px solid rgb(238, 238, 238);">
            <p>心内治疗决定</p>
            <el-form
              :inline="true"
              class="demo-form-inline pageForm"
              label-position="right"
              label-width="150px"
              disabled
              size="small"
            >
              <div class="formline">
                <el-form-item label="通知收入住院：">
                  <el-date-picker
                    v-model="item.notificationHospitalTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->

                <el-form-item label="转交：">
                  <el-date-picker v-model="item.deliverTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="" />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->

                <el-form-item label="转院：">
                  <el-date-picker
                    v-model="item.transferHospitalTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->
              </div>
              <div class="formline">
                <el-form-item label="通知CT室：">
                  <el-date-picker
                    v-model="item.informCTRoomTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->
                <el-form-item label="通知超声室：">
                  <el-date-picker
                    v-model="item.informUltrasoundRoomTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->
              </div>
              <div class="formline">
                <el-form-item label="启动导管室：">
                  <el-date-picker
                    v-model="item.startConduitChamberTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->
                <el-form-item label="静脉溶栓：">
                  <el-date-picker
                    v-model="item.intravenousThrombolysisTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder=""
                  />
                </el-form-item>
                <!-- <el-form-item label="">
										<el-input placeholder="被邀请者姓名" v-model="item.val"> </el-input>
									</el-form-item> -->
              </div>
            </el-form>
          </div>
        </div>
      </div>
      <!-- ************************************************邀请会诊弹出框************************************************ -->
      <el-dialog title="在线医生列表" :visible.sync="dialogGroupConsultation">
        <el-checkbox v-model="groupCheckAll" :indeterminate="isIndeterminateGroup" @change="handleCheckAllChange_Group">全选</el-checkbox>
        <!-- <div style="margin: 15px 0;"></div> -->
        <el-checkbox-group v-model="invitationList" @change="handleCheckedCitiesChange">
          <el-checkbox v-for="doct in doctorList" :key="doct.id" :label="doct.id">{{ doct.name }}</el-checkbox>
        </el-checkbox-group>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogGroupConsultation = false">取 消</el-button>
          <el-button type="primary" @click="invitationSend()">邀 请</el-button>
        </div>
      </el-dialog>
      <!-- ************************************************邀请会诊弹出框************************************************ -->
    </div>
    <!-- <div class="savebutton">
				<el-button type="primary" @click="saveResults()">保 存</el-button>
			</div> -->

  </div>
</template>

<script>
import { saveDescription, inviteConsultations, startConsultations, getDoctorList, getBaseInfo, getDetailInfo, getConsultationHistory } from '@/api/green-channel/basicInfo'

export default {
  // 由主页面(父组件) 接收来的, 选择项的数据
  props: ['checkrowdata'], // 由主页面(父组件) 接收来的, 选择项的数据
  data() {
    return {
      dialogGroupConsultation: false, // 邀请会诊弹出标识
      doctorList: [], // 医生名单
      invitationList: [], // 医生名单_选中提交
      doctorListAll: [], // 医生全选
      groupCheckAll: false, // 全选
      isIndeterminateGroup: false, //
      infoBasic: {
        'name': '',
        'sex': '',
        'age': '',
        'weight': '',
        'BMI': '',
        'incidentDateTime': '', // 来院时间,发病时间
        'modeOfArrival': '', // 来院方式
        'ambulanceDepartment': '', // 出车单位
        'helpDate': '', // 呼救时间
        'firstMedicalContactDateTime': '', // 首次医疗接触时间
        'inhospitalAdmissionTime': '', // 首诊医生接诊时间
        'arrivalTime': '', // 到达本院大门时间
        'cw120FirstDoctorName': '' // 医护人员
      },
      infoDetail: {
        'chiefComplaint': '', // 主诉
        'initialImpression': '', // 现病史
        'previousIllness': '', // 既往史
        'clinicalSignList': [ // 生命体征
          {
            'startTime': '',
            'endTime': '',
            'consciousnessNote': '',
            'rr': '',
            'pr': '',
            'hr': '',
            'sys': '',
            'dia': '',
            'spo2': '',
            't1': ''
          }
        ],
        'POCTList': [ // POCT
          {
            'startTime': '',
            'endTime': '',
            'consciousnessNote': '',
            'rr': '',
            'pr': '',
            'hr': '',
            'sys': '',
            'dia': '',
            'spo2': '',
            't1': ''
          }
        ],

        'bodychecklist': '', // 查体评估
        'meidicallist': '', // 当前给药
        'treatmentslist': '', // 当前处置
        'diagnosesModelList': '', // 当前诊断
        'consultationsTime': '', // 会诊时间
        'consultationsDoctorlist': '' // 会诊医生
      },
      treatmentDecision: { // 治疗决定-当前会诊
        'doctorName': '', // 参与会诊医生
        'ElectrocardiographicReportTime': '', // 心内报告时间
        'reportContent': '', // 心内意见
        'treatmentPlan': '', // 治疗方案
        'notificationHospitalTime': '', // 通知收入住院
        'deliverTime': '', // 转交
        'transferHospitalTime': '', // 转院
        'informCTRoomTime': '', // 通知CT室
        'informUltrasoundRoomTime': '', // 通知超声室
        'startConduitChamberTime': '', // 启动导管室
        'intravenousThrombolysisTime': '' // 静脉溶栓
      },
      decisionHistorical: [ // 治疗决定-历史会诊
        {
          'doctorName': '', // 参与会诊医生
          'ElectrocardiographicReportTime': '', // 心内报告时间
          'reportContent': '', // 心内意见
          'treatmentPlan': '', // 治疗方案
          'notificationHospitalTime': '', // 通知收入住院
          'deliverTime': '', // 转交
          'transferHospitalTime': '', // 转院
          'informCTRoomTime': '', // 通知CT室
          'informUltrasoundRoomTime': '', // 通知超声室
          'startConduitChamberTime': '', // 启动导管室
          'intravenousThrombolysisTime': '' // 静脉溶栓
        }
      ],
      imgUrlList: [], // 心电图片集合
      val: '',
      date: '',
      // this.$store.getters.consultationsId
      InConsultation: this.$store.getters.consultationsId,
      APITOKEN: this.$store.getters.apiToken,
      DISPATCHID: this.checkrowdata.dispatchId,
      // dispatchId : this.checkrowdata.dispatchId,
      SYSROLE: this.$store.getters.sysRole,
      USERID: this.$store.getters.userId

      // this.checkrowdata.patientId

      // var params = new URLSearchParams(document.location.search.substring(1))
      // var dispatchId = params.get('dispatchId') // 123
      // var SYSROLE = sessionStorage.getItem('SYSROLE') // 角色
      // var consultationsId = sessionStorage.getItem('consultationsId')   //会诊标识-放后做
      // var this.APITOKEN = window.top.document.getElementById('apiTokenId').value
      // var userId = window.top.document.getElementById('administrationID').value

    }
  },
  computed: {},
  updated() {},
  created() {
    console.log('接受值', this.checkrowdata)
    // getPatientInfo(this.checkrowdata.patientId).then(res => {
    //   this.persondata = res.data
    //   // this.count = res.count
    //   // console.log(res)
    // })
  },
  mounted() {
    this.queryDoctorList()
    this.queryBasicInfo()
  },
  methods: {
    reportChange() { // 	心电报告/治疗方案
      if (!this.InConsultation) {
        this.$message({
          message: '未发起会诊, 报告内容无法同步',
          type: 'warning'
        })
        return false
      }
      const saveData = {
        apiToken: this.APITOKEN,
        consultationsId: this.InConsultation,
        name: '心电报告',
        value: this.treatmentDecision.reportContent
      }
      saveDescription(saveData).then(res => {
        if (res.code === 9999) {
          this.$message({
            message: res.error,
            type: 'warning'
          })
        } else {
          console.log('保存会诊治疗意见')
          this.$message({
            message: '保存成功',
            type: 'success'
          })
        }
      }).catch(() => {
        this.$message.error('保存失败')
      })
    },

    programmeChange() { // 治疗方案
      if (!this.InConsultation) {
        this.$message({
          message: '未发起会诊, 治疗方案无法同步',
          type: 'warning'
        })
        return false
      }
      const saveData = {
        apiToken: this.APITOKEN,
        consultationsId: this.InConsultation,
        name: '治疗方案',
        value: this.treatmentDecision.treatmentPlan
      }

      saveDescription(saveData).then(res => {
        if (res.code === 9999) {
          this.$message({
            message: res.error,
            type: 'warning'
          })
        } else {
          console.log('保存治疗方案')
          this.$message({
            message: '保存成功',
            type: 'success'
          })
        }
      }).catch(() => {
        this.$message.error('保存失败')
      })
    },
    // saveResults() {				//页面大保存
    // 	let result = false;
    // 	// let url1 = "/saveDescription/?apiToken=" + this.APITOKEN + "&dispatchId=" + dispatchId

    // 	// $.ajax({		//保存会诊治疗意见
    // 	// 	method: "GET",
    // 	// 	url: "/saveDescription?apiToken=" + this.APITOKEN + "&consultationsId=" + consultationsId +"&description="+ this.treatmentDecision.reportContent,
    // 	// }).then((res) => {

    // 	// });

    // 	$.ajax({		//保存治疗方案
    // 		method: "GET",
    // 		url: "/saveTreatmentPlan?apiToken=" + this.APITOKEN + "&consultationsId=" + consultationsId +"&treatmentPlan="+ this.treatmentDecision.treatmentPlan,
    // 	}).then((res) => {
    // 	});
    // 	var sunData = {
    // 		"心内报告时间": this.treatmentDecision.ElectrocardiographicReportTime, //ElectrocardiographicReportTime
    // 		"通知收入住院": this.treatmentDecision.notificationHospitalTime, //notificationHospitalTime
    // 		"转交": this.treatmentDecision.deliverTime, //deliverTime
    // 		"转院": this.treatmentDecision.transferHospitalTime, //transferHospitalTime
    // 		"通知CT室": this.treatmentDecision.informCTRoomTime, //informCTRoomTime
    // 		"通知超声室": this.treatmentDecision.informUltrasoundRoomTime, //informUltrasoundRoomTime
    // 		"启动导管室": this.treatmentDecision.startConduitChamberTime, //startConduitChamberTime
    // 		"静脉溶栓": this.treatmentDecision.intravenousThrombolysisTime, //intravenousThrombolysisTime
    // 	}

    // 	for(let item in sunData){
    // 		$.ajax({		//保存治疗方案
    // 			method: "GET",
    // 			url: "/saveDispatchIncidents?apiToken=" + this.APITOKEN + "&consultationsId=" + consultationsId +"&name="+ item  +"&value=" +sunData[item],
    // 		}).then((res) => {
    // 		});
    // 	}
    // },

    invitationSend() { // 发起会诊
      if (this.invitationList.length === 0) {
        this.$message({
          message: '未选择会诊医生',
          type: 'warning'
        })
        return false
      }
      if (this.$store.getters.consultationsId) {
        // const url = '/consultation/inviteConsultations'
        const data = {
          'consultationsId': this.$store.getters.consultationsId,
          'apiToken': this.APITOKEN,
          'userId': this.invitationList.join()
        }
        inviteConsultations(data).then(res => {
          if (res.code === 9999) {
            this.$message({
              message: res.error,
              type: 'warning'
            })
          } else {
            this.$message({
              showClose: true,
              message: '成功发送邀请',
              type: 'success'
            })
            this.invitationList = []
            this.dialogGroupConsultation = false
          }
        }).catch(() => {
          this.$message.error('未能成功发送邀请')
        })
      } else {
        // const url = '/startConsultations'
        const subData = {
          dispatchid: this.DISPATCHID,
          diseasetype: '胸痛',
          consultationtype: '心电诊断',
          fromuserid: this.USERID,
          touserids: this.invitationList.join(),
          status: 0,
          apiToken: this.APITOKEN
        }

        startConsultations(subData).then(res => {
          if (res.code === 9999) {
            this.$message({
              message: res.error,
              type: 'warning'
            })
          } else if (res.code === 0) {
            this.$message({
              message: '成功发送邀请',
              type: 'success'
            })
            // this.InConsultation = sessionStorage.setItem('consultationsId', res.data)
            this.InConsultation = this.$store.commit('user/SET_CONSULTATIONSID', res.data) // 存储会诊标识CONSULTATIONSID
            this.invitationList = []
            this.dialogGroupConsultation = false
          }
        }).catch(() => {
          this.$message.error('未能成功发送邀请')
        })
      }
    },
    handleCheckAllChange_Group(val) { // 全选变换事件
      this.invitationList = val ? this.doctorListAll : []
      this.isIndeterminateGroup = false
    },
    handleCheckedCitiesChange(value) { // 全选变换事件
      const checkedCount = value.length
      this.groupCheckAll = checkedCount === this.doctorList.length
      this.isIndeterminateGroup = checkedCount > 0 && checkedCount < this.doctorList.length
    },
    queryDoctorList() { // 查询在线医生名单
      // const url = '/getUserList
      const data = {
        dispatchId: this.DISPATCHID,
        // role: this.SYSROLE,
        role: '心内科'
      }
      getDoctorList(data).then(res => {
        this.doctorList = res.data.department1DoctorList
        this.doctorListAll = this.doctorList.map(el => {
          return el.id
        })
      })

      // $.ajax({
      //   method: 'GET',
      //   url: url
      // // data: {'token': localStorage.getItem("access_token")},
      // // dataType: 'json'
      // }).then((res) => {
      //   this.doctorList = res.data.department1DoctorList
      //   this.doctorListAll = this.doctorList.map(el => {
      //     return el.id
      //   })
      // })
    },
    queryBasicInfo() { // 查询信息
      const data = {
        dispatchId: this.DISPATCHID,
        consultationsId: this.InConsultation
      }
      // getBaseInfo
      getBaseInfo(data).then(res => {
        if (!!res && res.data) {
          res = res.data
        } else {
          return false
        }
        /** ****************** 基本信息*******************/
        this.infoBasic.name = res.name
        this.infoBasic.sex = res.sex
        this.infoBasic.age = res.age
        this.infoBasic.weight = res.weight
        this.infoBasic.BMI = res.BMI
        this.infoBasic.incidentDateTime = res.incidentDateTime // 来院时间,发病时间
        this.infoBasic.modeOfArrival = res.modeOfArrival // 来院方式
        this.infoBasic.ambulanceDepartment = res.ambulanceDepartment // 出车单位
        this.infoBasic.helpDate = res.helpDate // 呼救时间
        this.infoBasic.firstMedicalContactDateTime = res.firstMedicalContactDateTime // 首次医疗接触时间
        this.infoBasic.inhospitalAdmissionTime = res.inhospitalAdmissionTime // 首诊医生接诊时间
        this.infoBasic.arrivalTime = res.arrivalTime // 到达本院大门时间
        this.infoBasic.cw120FirstDoctorName = res.cw120FirstDoctorName // 医护人员
        this.imgUrlList = res.imgUrlList // 心电图片集合
      /** ****************** 基本信息-End*******************/
      })
      getDetailInfo(data).then(res => {
        if (!!res && res.data) {
          res = res.data
        } else {
          return false
        }
        /** ****************** 详细信息*******************/
        if (!!res.clinicalSignList && res.clinicalSignList.length > 0) {
          this.infoDetail.clinicalSignList = res.clinicalSignList // 生命体征
        }
        this.infoDetail.chiefComplaint = res.chiefComplaint // 主诉
        this.infoDetail.initialImpression = res.initialImpression // 现病史
        this.infoDetail.previousIllness = res.previousIllness // 既往史
        this.infoDetail.bodychecklist = res.bodychecklist // 查体评估
        this.infoDetail.meidicallist = res.meidicallist // 当前给药
        this.infoDetail.treatmentslist = res.treatmentslist // 当前处置
        this.infoDetail.diagnosesModelList = res.diagnosesModelList // 当前诊断
        this.infoDetail.consultationsTime = res.consultationsTime // 会诊时间
        this.infoDetail.consultationsDoctorlist = res.consultationsDoctorlist // 会诊医生
        /** ****************** 详细信息-End***************/
        /** ****************** 治疗决定*******************/
        /** ****************** 本次_治疗决定*******************/
        this.treatmentDecision.doctorName = res.doctorName // 参与会诊医生
        this.treatmentDecision.ElectrocardiographicReportTime = res.ElectrocardiographicReportTime // 心内报告时间
        this.treatmentDecision.notificationHospitalTime = res.notificationHospitalTime // 通知收入住院
        this.treatmentDecision.deliverTime = res.deliverTime // 转交
        this.treatmentDecision.transferHospitalTime = res.transferHospitalTime // 转院
        this.treatmentDecision.informCTRoomTime = res.informCTRoomTime // 通知CT室
        this.treatmentDecision.informUltrasoundRoomTime = res.informUltrasoundRoomTime // 通知超声室
        this.treatmentDecision.startConduitChamberTime = res.startConduitChamberTime // 启动导管室
        this.treatmentDecision.intravenousThrombolysisTime = res.intravenousThrombolysisTime // 静脉溶栓
      /** ****************** 本次_治疗决定-End***************/
      /** ****************** 治疗决定-End*******************/
      })

      /*
        *查询历史_治疗决定
      */
      const historyData = {
        apiToken: this.APITOKEN,
        dispatchId: this.DISPATCHID
      }
      getConsultationHistory(historyData).then(res => { // 查询历史_治疗决定
        if (!!res && res.data && res.data.length > 0) {
          this.decisionHistorical = res.data
        } else {
          return false
        }
      })
    }
  }
}
</script>
<!--
<script type="text/javascript">
var params = new URLSearchParams(document.location.search.substring(1))
var dispatchId = params.get('dispatchId') // 123
var SYSROLE = sessionStorage.getItem('SYSROLE') // 角色
var consultationsId = sessionStorage.getItem('consultationsId')   //会诊标识-放后做
var this.APITOKEN = window.top.document.getElementById('apiTokenId').value
var userId = window.top.document.getElementById('administrationID').value
</script>
      <script type="text/javascript">
      var basicInfoGroup = new Vue({
      el: "#basicInfo",
      data: {},
      mounted() {},
      methods: {},
      })
    </script> -->
    <style scoped>
      #basicInfo {
      position: relative;
      /* margin-top: 100px; */
      }

      .savebutton {
      position: fixed;
      bottom: 30px;
      right: 15px;
      }

      .title_lv3 {
      font-size: 20px;
      color: #4380EA;
      }

      .pageForm {
      margin: 20px;
      }

      .disInBlock {
      display: inline-block;
      }

      .disBlock .el-form-item__content {
      width: 80%;
      }

      .imgStyle {
      width: 400px;
      margin: 0 5px;
      }

      .marLeft_20 {
      margin-left: 20px;
      }

      .minWidth_200 {
      min-width: 200px
      }

      .treatment_decision_info {
      position: relative;
      }

      .treatment_decision_info_T_R {
      top: 5px;
      }

      .treatment_decision_info_B_R {
      bottom: 5px;
      }

      .treatment_decision_info_T_R,
      .treatment_decision_info_B_R {
      position: absolute;
      right: 10px;
      font-size: 15px;
      color: #666666;
      }
      .el-message {
      top: 270px!important;
      }
    </style>
  </cript></template>
